package com.mapull.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 并发 List
 * @author mapull
 */
public class ConcurrentList {

    public static void main(String[] args) {
        addEle();
    }

    private static void addEle(){
        List<String> list = new ArrayList<>();
        list.add("Ada");

        Iterator<String> iterator = list.iterator();
        list.add("Bob");

        while (iterator.hasNext()) {
            String next = iterator.next();
            iterator.remove();
        }
    }
}
